<?php

require_once("utils/template.php");
require_once("utils/db.php");

//////////////////////////////////////
// Business/Data Layer
//////////////////////////////////////

//TODO Get the right client id
$id_client = 1;

$sql = "select f_titre, loc_deb
from locations, films
where f_id = loc_film
and loc_cli = $id_client
order by loc_deb";

$rq = execQuery($sql);
$res = $rq->fetchAll();


//////////////////////////////////////////
// View Layer
//////////////////////////////////////////
$main = new Template('views/historique_locations.view.php', array(
    'title' => 'Historique Locations',
    'res' => $res,
));
$main->render();


?>
